#ifndef MS_HTTP_SERVER_HPP
#define MS_HTTP_SERVER_HPP

#include "httplib.h"
#include "json.hpp"
#include "RoomInfo/RoomInfo.h"

using namespace std;

class HttpServer 
{
    
public:
    explicit HttpServer(RoomInfo *);
    void run();
    static uint64_t getTimestampMs();
    static string strRand(int length);
    void getState();
public:
    static int message_id;
private:
    void newPeer();
    void newtransport();
    void connectTrasnport();
    void sendTrack();
    void recvTrack();
    void syncState();
    void sendAudioTrack(const httplib::Request& req, httplib::Response& res);
    void sendVideoTrack(const httplib::Request& req, httplib::Response& res);
    void observerAddProducer(std::string);
    void resumeConsumer();
private:
	httplib::Server svr;
    RoomInfo *room_one;

};


#endif
